package com.yzqp.blog.interceptor;

import com.yzqp.common.log.LogUtil;
import com.yzqp.common.result.WebJsonResultUtil;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Component
public class DefaultInterceptor extends BaseInterceptor {

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        LogUtil.getBean().info("DefaultInterceptor: >>>>>> " + request.getRequestURI());
        responseWrite(response, WebJsonResultUtil.error("Invalid Request!"));
        return false;
    }
}
